Namespace Kardex
Public Class Kardex
	Inherits Auditoria.Transaccion

	Private vKardexId As Integer = -1
	Private vProductoId As Integer = -1
	Private vProductoNombre As string =""
	Private vALmacenId As String = ""
	Private vALmacenNombre As string =""
	Private vTipoId As Integer = -1
	Private vTipoNombre As string =""
	Private vCantidad As Integer = -1
	Private vCantidadIn As Integer = -1
	Private vCantidadOut As Integer = -1
	Private vTotal As Integer = -1
	Private vFecha As Long = 0
	Private vTipoMovimientoId As Integer = -1
	Private vTipoMovimientoNombre As string =""
	Private vReferencia As Integer = -1

	Public Property KardexId() As Integer
		Get
			Return vKardexId
		End Get
		Set(ByVal Value As Integer)
			vKardexId = Value
		End Set
	End Property

	Public Property ProductoId() As Integer
		Get
			Return vProductoId
		End Get
		Set(ByVal Value As Integer)
			vProductoId = Value
		End Set
	End Property

	Public Property ProductoNombre() as string
		Get
			Return vProductoNombre
		End Get
		Set(ByVal Value As string)
			vProductoNombre = Value
		End Set
	End Property

	Public Property ALmacenId() As String
		Get
			Return vALmacenId
		End Get
		Set(ByVal Value As String)
			vALmacenId = Value
		End Set
	End Property

	Public Property ALmacenNombre() as string
		Get
			Return vALmacenNombre
		End Get
		Set(ByVal Value As string)
			vALmacenNombre = Value
		End Set
	End Property

	Public Property TipoId() As Integer
		Get
			Return vTipoId
		End Get
		Set(ByVal Value As Integer)
			vTipoId = Value
		End Set
	End Property

	Public Property TipoNombre() as string
		Get
			Return vTipoNombre
		End Get
		Set(ByVal Value As string)
			vTipoNombre = Value
		End Set
	End Property

	Public Property Cantidad() As Integer
		Get
			Return vCantidad
		End Get
		Set(ByVal Value As Integer)
			vCantidad = Value
		End Set
	End Property

	Public Property CantidadIn() As Integer
		Get
			Return vCantidadIn
		End Get
		Set(ByVal Value As Integer)
			vCantidadIn = Value
		End Set
	End Property

	Public Property CantidadOut() As Integer
		Get
			Return vCantidadOut
		End Get
		Set(ByVal Value As Integer)
			vCantidadOut = Value
		End Set
	End Property

	Public Property Total() As Integer
		Get
			Return vTotal
		End Get
		Set(ByVal Value As Integer)
			vTotal = Value
		End Set
	End Property

	Public Property Fecha() As Long
		Get
			Return vFecha
		End Get
		Set(ByVal Value As Long)
			vFecha = Value
		End Set
	End Property

	Public readonly  Property FechaStr() as string
		Get
			Return System.DateTime.FromFileTime(Fecha).ToShortDateString
		End Get
	End Property

	Public Property TipoMovimientoId() As Integer
		Get
			Return vTipoMovimientoId
		End Get
		Set(ByVal Value As Integer)
			vTipoMovimientoId = Value
		End Set
	End Property

	Public Property TipoMovimientoNombre() as string
		Get
			Return vTipoMovimientoNombre
		End Get
		Set(ByVal Value As string)
			vTipoMovimientoNombre = Value
		End Set
	End Property

	Public Property Referencia() As Integer
		Get
			Return vReferencia
		End Get
		Set(ByVal Value As Integer)
			vReferencia = Value
		End Set
	End Property

	Sub New()
	End Sub

	Sub New(ByRef KardexId As Integer, ByVal ProductoId As Integer, ByVal ALmacenId As String, ByVal TipoId As Integer, ByVal Cantidad As Integer, ByVal CantidadIn As Integer, ByVal CantidadOut As Integer, ByVal Total As Integer, ByVal Fecha As Long, ByVal TipoMovimientoId As Integer, ByVal Referencia As Integer)
		vKardexId = KardexId
		vProductoId = ProductoId
		vALmacenId = ALmacenId
		vTipoId = TipoId
		vCantidad = Cantidad
		vCantidadIn = CantidadIn
		vCantidadOut = CantidadOut
		vTotal = Total
		vFecha = Fecha
		vTipoMovimientoId = TipoMovimientoId
		vReferencia = Referencia
	End Sub

End Class



 Public Class KardexCol   
 Inherits System.Collections.CollectionBase
Private _enmSortDirection As SortDirection
Public Sub New()
_enmSortDirection = SortDirection.Asc
End Sub
Public Sub Sort(ByVal sortExpression As String, ByVal sortDirection As SortDirection)
InnerList.Sort(New Comparer(sortExpression, SortDirection))
End Sub
Public Sub Sort(ByVal sortExpression As String)
InnerList.Sort(New Comparer(sortExpression, _enmSortDirection))
If _enmSortDirection = SortDirection.Asc Then
_enmSortDirection = SortDirection.Desc
Else
_enmSortDirection = SortDirection.Asc
End If
End Sub
Public Function Add(ByVal obj As Kardex) As Integer
Return MyBase.List.Add(obj)
End Function
Public Sub AddPrimero(ByVal obj As Kardex)
MyBase.List.Insert(0, obj)
End Sub
Public ReadOnly Property Kardex(ByVal Index As Integer) As Kardex
Get
Return CType(MyBase.List(Index), Kardex)
End Get
End Property
End Class
end namespace

